#pragma once

#include "base/core/singleton.h"
#include "BuffEffectLogic.h"
#include "BuffEffectLogicAll.h"

#include <map>

#define REGISTER_LOGIC(num, LOGIC)	{ Register(num, (new LOGIC())); }

class BuffLogicManager : public ManualSingleton<BuffLogicManager>
{
	friend class  ManualSingleton < BuffLogicManager > ;
public:
	BuffLogicManager();

	~BuffLogicManager();
public:
	bool Init();
	bool UnInit();
public:
	void Register(int32_t id, IBuffLogic* pLogic);

	IBuffLogic* GetBuffLogic(int logicId);
protected:
	std::map<uint32_t, IBuffLogic*>	m_buffLogic;
};

#define g_MakeBuffLogicManager() (BuffLogicManager::Instance())
#define g_GetBuffLogicManager()  (BuffLogicManager::GetInstance())
#define g_DelBuffLogicManager()  (BuffLogicManager::Destroy())
